<div class="groups index">
	<h2><?php echo __('Listado de Notas'); ?></h2>
	<table cellpadding="0" cellspacing="0">
	<tr>
			<th><?php echo $this->Paginator->sort('id'); ?></th>
			<th><?php echo $this->Paginator->sort('name'); ?></th>
			<th><?php echo $this->Paginator->sort('institution_id'); ?></th>
			<th> <?php echo __('alumnos') ?> </th>

			<th class="actions"><?php echo __('Notas'); ?></th>
	</tr>	
	<?php foreach ($groups as $group): ?>
	<tr>
		<td><?php echo h($group['Group']['id']); ?>&nbsp;</td>
		<td><?php echo h($group['Group']['name']); ?>&nbsp;</td>
		<td>
			<?php echo $this->Html->link($group['Institution']['nombre'], array('controller' => 'institutions', 'action' => 'view', $group['Institution']['id'])); ?>
		</td>
		<!-- aqui se listaran los alumnos pertenecientes a la intitucion -->
		<td>
            <?php $lider=" ";?>
            <?php $groupuser=" ";?>
	   		     <?php foreach ($groupsUsers as $alumno): ?>
		     	<?php if ($alumno['GroupUser']['group_id']==$group['Group']['id']): ?>
		     		<?php echo h($alumno['User']['nombres']); ?>&nbsp;
  							
		     		<!--<?php echo h($alumno['EvaluationsUser']['evaluation_id']); ?>&nbsp;-->
				<?php $groupuser=$alumno['GroupUser']['id'];?>
		     		<?php if ($alumno['GroupUser']['lider']==1): ?>
		     		<?php $lider=$alumno['User']['id'] ;?>
		     		<?php endif; ?>
		     	     <p> </p>
		     	<?php endif; ?>
			 
		     <?php endforeach; ?>
            
		</td>
		<td class="actions">
			<!-- es en esta parte donde se tienen ke obtener las notas de la misma forma que los alumnos-->
				<td>
            <?php $lider=" ";?>
            <?php $groupuser=" ";?>
		  <?php $nouser=" ";?>
		     <?php foreach ($groupsUsers as $alumno): ?>
		     	<?php if ($alumno['GroupUser']['group_id']==$group['Group']['id']): ?>
		     		<?php foreach ($evaluationsUsers as $nouser): ?>	
				<?php if ($alumno['User']['id']==$nouser['EvaluationsUser']['user_id']): ?>
 			     	<?php echo h($nouser['EvaluationsUser']['nota']); ?>&nbsp;
				<?php endif; ?>
			       <?php endforeach; ?>
		     		<?php $groupuser=$alumno['GroupUser']['id'];?>
		     		<?php if ($alumno['GroupUser']['lider']==1): ?>
		     		<?php $lider=$alumno['User']['id'] ;?>
		     		<?php endif; ?>
		     	     <p> </p>
		     	<?php endif; ?>
		     <?php endforeach; ?>
            
		</td> 
        										
    									
											
				

			<!-- aqui tienes que agregar las llamadas al metodo crear del controlador evaluations 
<!--			<?php echo $this->Html->link(__('Evaluar video'), array('action' => 'boton_evaluar', $group['Group']['id'],$group['Institution']['id'],'Video',$groupuser,$lider)); ?> -->
<!--			<?php echo $this->Html->link(__('Evaluar informe'), array('action' => 'boton_evaluar', $group['Group']['id'],$group['Institution']['id'],'Informe',$groupuser,$lider)); ?> -->
		</td>
	</tr>
<?php endforeach; ?>
	</table>
	<p>
	<?php
	echo $this->Paginator->counter(array(
	'format' => __('Page {:page} of {:pages}, showing {:current} records out of {:count} total, starting on record {:start}, ending on {:end}')
	));
	?>	</p>
	<div class="paging">
	<?php
		echo $this->Paginator->prev('< ' . __('previous'), array(), null, array('class' => 'prev disabled'));
		echo $this->Paginator->numbers(array('separator' => ''));
		echo $this->Paginator->next(__('next') . ' >', array(), null, array('class' => 'next disabled'));
	?>
	</div>
</div>

